package com.my.array;

import java.util.Arrays;
import java.util.OptionalInt;

/**
 * @author marshal
 * @version 2021-05-21
 */
public class ArrayTest {
    public static void main(String[] args) {
        // 1. 先声明再赋值
        int[] a = new int[2];
        a[0] = 10;
        a[1] = 20;
        System.out.println(Arrays.toString(a));
        // 2. 声明并赋值
        int[] b = {1, 2, 3, 4, 5};
        System.out.println(Arrays.toString(b));
    }
}
